from django.shortcuts import render
from django.http.response import HttpResponse
from django.views.decorators.csrf import csrf_exempt
from django.views.generic.base import View
from Chat.Reply import getReply
# Create your views here.

class Reply(View):
    @csrf_exempt
    def dispatch(self, request, *args, **kwargs):
        return super(Reply,self).dispatch(request, *args,**kwargs)

    def get(self,request):
        content = request.GET.get('content','')
        reply = getReply(content)
        return HttpResponse(reply)

    def post(self,request):
        content = request.POST.get('content','')
        reply = getReply(content)
        return HttpResponse(reply)